package com.cbwl.eoas.web.framework.util;

import org.junit.runner.RunWith;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.transaction.annotation.Transactional;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = { "classpath*:spring/spring-mvc.xml", "classpath*:spring/spring.xml"})
@Transactional(transactionManager = "transactionManager")
public class BaseJunitTest extends AbstractTransactionalJUnit4SpringContextTests {

	// 模拟request,response
	protected MockHttpServletRequest request;

	protected MockHttpServletResponse response;

	@org.junit.Before
	public void init() {
		request = new MockHttpServletRequest();
		request.setCharacterEncoding("UTF-8");
		response = new MockHttpServletResponse();
	}

}